package com.kongjian.manage.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kongjian.manage.model.vo.UserVO;
import com.kongjian.manage.common.R;
import com.kongjian.manage.model.dto.NewUserDTO;
import com.kongjian.manage.model.dto.UpdateUserDTO;
import com.kongjian.manage.model.query.UserQuery;
import com.kongjian.manage.model.entity.UserEntity;

/**
* @author tangjunfeng
* @Classname IUserService.java
* @Description 用户service
* @Date 2023-10-09
* @Version V1.0
*/
public interface IUserService extends IService<UserEntity> {

    /**
    * 分页查询
    * @param query
    * @return
    */
    R<Page> queryPageUser(UserQuery query)  throws Exception;


   /**
     * 根据实体查询VO对象
     * @param id ID
     */
    UserVO getByIdUser(Long id) throws Exception;

   /**
    * 新增
    * @param userDTO DTO
    */
    void addUser(NewUserDTO userDTO) throws Exception;


   /**
    * 更新
    * @param id ID
    * @param userDTO DTO对象
    */
   void modifyUser(Long id,UpdateUserDTO userDTO) throws Exception;

   /**
    * 根据ID删除
    * @param id ID
    */
   void deleteUser(Long id) throws Exception;

   /**
    * 统计
    * @param query 查询实体
    */
   Integer countUser(UserQuery query);

}
